<template>
  <div class="dashboard-container">
    <el-row :gutter="20">
      <el-col :span="12" class="myrow">
        <el-card>
          <workCalendar :localDate="new Date()"></workCalendar>
        </el-card>
      </el-col>
      <el-col :span="12">
        <el-card>
          流程申请
          <div>
            <el-button @click="fn">改变语言</el-button>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Cookie from "js-cookie";
import workCalendar from "./components/work-calender.vue";
export default {
  name: "Dashboard",
  components: { workCalendar },
  methods: {
    fn() {
      // 切换语言
      this.$i18n.locale === "en"
        ? (this.$i18n.locale = "zh")
        : (this.$i18n.locale = "en");
      // 将结果保存到 cookie 中
      Cookie.set("locale", this.$i18n.locale);
      // 自动刷新
      this.$router.go(0);
    }
  }
};
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    padding: 30px;
    .myrow {
    }
  }
}
</style>
